import type { AxiosRequestConfig, AxiosResponse } from 'axios'

// 请求/响应拦截器
export interface WJInterceptors<T = AxiosResponse> {
  requestInterceptor?: (config: AxiosRequestConfig) => AxiosRequestConfig
  requestInterceptorCatch?: (error: any) => any
  responseInterceptor?: (res: T) => T
  responseInterceptorCatch?: (error: any) => any
}

// 请求参数
export interface WJRequestConfig<T = AxiosResponse> extends AxiosRequestConfig {
  interceptors?: WJInterceptors<T>
  showLoading?: boolean
}

// 返回数据类型
export interface DataType {
  data: any
  returnCode: string
  success: boolean
}
